package com.ruoyi.ruonorder.mapper;

import com.ruoyi.ruonorder.domain.OrderInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 抢单功能Mapper接口
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
@Mapper
public interface OrderInfoMapper 
{
    @Select("select * from order_info where id = #{id}")
    OrderInfo getById(Long id);
    @Select("select * from order_info where order_status = 0")
    List<OrderInfo> selectOnePendingOrder();
    @Update("update order_info set order_status = 1 where id = #{id}")
    int updateOrderDriverIdAndStatus(Long id);

}
